<template>
	<div class="header-bar">
		<div class="title">{{title}}</div>
		<image v-if="backStatus==='1'" src="/static/icon-back-white.png" class="back" @click="back"></image>
	</div>
</template>

<script>
	export default {
		name: "custom-header-bar",
		props: {
			title: { // 标题
				type: String,
				default: ''
			},
			backStatus: { // 是否显示返回按钮  '0'不显示    '1'显示
				type: String,
				default: '0'
			},
		},
		mounted() {},
		data() {
			return {};
		},
		methods: {
			back() {
				uni.navigateBack()
			}
		}
	}
</script>

<style lang="scss">
	@import '@/utils/variable.scss';

	.header-bar {
		position: fixed;
		z-index: 66;
		top: 0;
		left: 0;
		right: 0;
		height: 140upx;
		padding: 48upx 0 0upx;
		box-sizing: border-box;
		background-image: url(/static/bg-top.png);
		background-size: cover;
		text-align: center;
		color: $base-color;
		font-size: 36upx;

		.title {
			height: 66upx;
			line-height: 66upx;
		}

		.back {
			position: absolute;
			top: 54upx;
			left: 24upx;
			width: 52upx;
			height: 52upx;
		}
	}
</style>
